<?php
namespace app\index\model;

use think\facade\Session;
use think\Model;

class ShoppingChar extends Model
{
    protected $pk = 'id';
    public static function cartList()
    {
        $list = ShoppingChar::alias('sc')
            ->field('sc.*,p.name,p.photo_x')
            ->where('sc.uid','=',Session::get('user'))
            ->join('product p','p.id=sc.pid')
            ->select();
        return $list;
    }

}